package com.dynamic.data.example.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.enums.SqlKeyword;
import com.dynamic.data.permission.annotation.ResourceFieldCheck;
import com.dynamic.data.permission.annotation.ResourceTableCheck;
import com.dynamic.data.permission.common.enums.ResoureFieldType;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.Date;


@ResourceTableCheck
@Getter
@Setter
@NoArgsConstructor
@TableName("tb_task")
public class TbTask {

    @TableId("id")
    private Integer id;

    @TableField(value = "task_name", keepGlobalFormat = true)
    private String taskName;

    @TableField(value = "task_detail", keepGlobalFormat = true)
    private String taskDetail;


    @ResourceFieldCheck(code = ResoureFieldType.USER_ID)
    @TableField(value = "user_id", keepGlobalFormat = true)
    private Long userId;

    @ResourceFieldCheck(code = ResoureFieldType.START_TIME,compare= SqlKeyword.GE)
    @TableField(value = "create_time", keepGlobalFormat = true)
    private Date createTime;

}
